package cn.seaboot.admin.starter;

import org.springframework.boot.web.server.ErrorPageRegistrar;
import org.springframework.boot.web.server.ErrorPageRegistry;
import org.springframework.context.annotation.Configuration;

/**
 * if didn't catch exceptions in exception's aspect, will deal with in this default configuration
 *
 * @author Mr.css
 * @version 2019-12-18 9:12
 */
@Configuration
public class ErrorPageConfig implements ErrorPageRegistrar {

    /**
     * Register pages as required with the given registry.
     *
     * @param registry -
     */
    @Override
    public void registerErrorPages(ErrorPageRegistry registry) {
//         ErrorPage e404 = new ErrorPage(HttpStatus.NOT_FOUND, "/error/404.html");
//         ErrorPage e403 = new ErrorPage(HttpStatus.FORBIDDEN, "/error/403.html");
//         ErrorPage e500 = new ErrorPage(HttpStatus.INTERNAL_SERVER_ERROR, "/error/500.html");
//         registry.addErrorPages(e403, e404, e500);
    }
}
